﻿using Autofac;
using Microsoft.AspNetCore.Builder;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using xjjxmm.infrastructure.Middleware;
using xjjxmm.infrastructure.Middleware.RepeatSubmit;

namespace xjjxmm.infrastructure.compont;

public class ExceptionHandlerCompont : ICompont
{
    public int Order { get; set; } = 200;

    public bool Regist(ContainerBuilder builder)
    {
        builder.RegisterType<ExceptionHandlerMiddleware>().SingleInstance();
        return false;
    }

    public bool Use(WebApplication app)
    {
        app.UseMiddleware<ExceptionHandlerMiddleware>();

        return true;
    }
}
